$(function(){
    var str = location.search.slice(1).split("&");
    var obj = {};
    var arr = [];
    for (var i = 0; i < str.length; i++) {
        arr[i] = str[i].split("=");
        obj[arr[i][0]] = arr[i][1];       
    }
    $.ajax({
        type: "get",
        url: "http://193.112.55.79:9090/api/getproductlist?categoryid=0",
        dataType: "json",
        success: function (res) {  
            for(var i=0;i<res.result.length;i++){
                res.result[i]._Id=obj._id;
            }
            var html = template("td", res.result);
            $(".product-bijia").prepend(html);
            $.ajax({
                type: "get",
                url: "http://193.112.55.79:9090/api/getproductcom?productid="+obj.productId,
                dataType: "json",
                success: function (res) {
                    var html = template("tp", res.result);
                    $(".qq_listitem").html(html);
                }
        
            })
        }
    });
    // console.log(obj);
 
})